<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DOM常见事件</title>
</head>
<body>
    <input type="text" id="input" value="请输入内容">
    <button id="btn">点击</button>
    <input type="submit" id="btn2" value="提交">

    <script>
        let input = document.querySelector("#input");
        let btn = document.querySelector("#btn");
        let btn2 = document.querySelector("#btn2");

        input.addEventListener("input", function () {
            console.log("input事件触发");
        });

        btn.addEventListener("click", function () {
            console.log("click事件触发");
        });

        btn2.addEventListener("click", function () {
            console.log("click事件触发");  
        })
    </script>
</body>
</html>